package com.example.ticketorder.service;

import com.example.ticketorder.entity.Sales;
import com.example.ticketorder.repository.dao.SalesDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Date;
import java.sql.Time;
import java.util.List;

@Service
public class SalesService {
    @Resource
    private SalesDao salesDao;
    public Sales add(Sales sale){
        salesDao.add(sale);
        return  sale;
    }
    public Iterable<Sales> findSales(String order, String phone){
        return salesDao.findSales(order,phone);
    }
    public void insertSale(String order_Number, String phone, String car, String destination, Date date, Time timea,Time timeb, double money){
        salesDao.insertSale(order_Number,phone,car,destination,date,timea,timeb,money);
    }
    public void deleteSale(String order_Number, String phone){
        salesDao.deleteSale(order_Number,phone);
    }
}
